﻿using ApiScanner.Core;
using InfiniTec;

namespace ApiScannerShell.ViewModels
{
    public sealed class ServerNameConfigurationElementViewModel : ViewModel<ServerNameConfigurationElementViewModel, ServerNameConfigurationElement>
    {
        public string Name
        {
            get { return GetValue(v => v.Name); }
            set { SetValue(v => v.Name, value); }
        }


        public ServerNameConfigurationElementViewModel(ServerNameConfigurationElement element) : base(element)
        {
            AddSimpleMapping(v =>v.Name, () => Name.IsNullOrEmpty() ? "The servername must be be specified." : null);

            LoadValuesFromModel();
        }
    }
}